package cn.edu.bcu.ls.controller;

import cn.edu.bcu.ls.entity.Order;

import cn.edu.bcu.ls.entity.Question;
import cn.edu.bcu.ls.serviceImpl.QuestionService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@CrossOrigin(origins = { "http://localhost:8081", "null" })
@RestController
public class QuestionController {
    @Autowired
    private QuestionService questionService;
    
    @ApiOperation(value = "上传问题，传入你想要的传的值就行")
    @GetMapping(value="question")
    public boolean insertOrder(Question question) {
        if (questionService.insert(question) >0) {
            return true;
        }else {
            return false;
        }
    }

}
